package com.financing.wap.dao.impl;


import com.financing.wap.common.SqlName;
import com.financing.wap.dao.IFpFaUserContractDao;
import com.financing.wap.dto.FpFaUserContractDTO;
import org.springframework.stereotype.Repository;

import java.sql.SQLException;
import java.util.List;

/**
 * fp_fa_user_contract  
 * 理财师-合同管理 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpFaUserContractDao")
public class FpFaUserContractDaoImpl extends BaseDaoImpl<FpFaUserContractDTO, Integer> implements IFpFaUserContractDao {


	@Override
	public int insert(FpFaUserContractDTO fpFaUserContract) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.FpFaUserContractSql.insert, fpFaUserContract);
	}

	@Override
	public void update(FpFaUserContractDTO fpFaUserContract) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpFaUserContractSql.update, fpFaUserContract);
	}

	@Override
	public void updateForce(FpFaUserContractDTO fpFaUserContract) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpFaUserContractSql.updateForce, fpFaUserContract);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.FpFaUserContractSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<FpFaUserContractDTO> queryList(FpFaUserContractDTO fpFaUserContract) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.FpFaUserContractSql.queryList, fpFaUserContract);
	}

	@Override
	public int queryListCount(FpFaUserContractDTO fpFaUserContract) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.FpFaUserContractSql.queryListCount, fpFaUserContract);
	}

	@Override
	public FpFaUserContractDTO loadById(Integer id) throws SQLException {
		return  (FpFaUserContractDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.FpFaUserContractSql.loadById,id);
	}

	@Override
	public Class<FpFaUserContractDTO> getEntityClass() {
		return FpFaUserContractDTO.class;
	}
 	
}
